package com.hujing.eventpublish.Controller;

import com.hujing.eventpublish.event.BizEvent;
import com.hujing.eventpublish.service.EventEngine;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class TestController {

    @Autowired
    private EventEngine eventEngine;

    @GetMapping("/test")
    public void test() {
        //发布事件
        eventEngine.publishEvent(new BizEvent("Hello World!"));
    }

}
